using System;
using UnityEngine;

namespace Weapons
{
    public class AnimationEventHandler : MonoBehaviour
    {
        public event Action OnFinish;
        public event Action OnStartMovement;
        public event Action OnStopMovement;
        public event Action OnAttackAction;
        public event Action OnMinHoldPase;
        public event Action<AttackPhases> OnEnterAttackPhase;


        public void AnimationFinishTrigger()
        {
            OnFinish?.Invoke();
        }

        public void StartMovementTrigger()
        {
            OnStartMovement?.Invoke();
        }

        public void StopMovementTrigger()
        {
            OnStopMovement?.Invoke();
        }

        //�������������ڿγ���ʹ�õ���private���ͣ��������д�������Ҳ���
        public void AttackActionTrigger()
        {
            OnAttackAction?.Invoke();
        }

        private void MinHoldPassedTriger()
        {
            OnMinHoldPase?.Invoke();
        }

        private void EnterAttackPhase(AttackPhases phase)
        {
            OnEnterAttackPhase?.Invoke(phase);
        }
    }
}